<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>Microchip MCP23008<br/>
<small>
[<a class="el" href="group__other.html">Other</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="microchip-mcp23008_8h.html">microchip-mcp23008.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Microchip MCP23008 driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga8a33d4282df2429f6736aeb043cab6c5">MCP_REG_IODIR</a>&#160;&#160;&#160;0x00</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga6435c71cc8eb951b14a25a55d4102697">MCP_REG_IPOL</a>&#160;&#160;&#160;0x01</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga90bb931e62804ca37a9300703b8fe75e">MCP_REG_GPINTEN</a>&#160;&#160;&#160;0x02</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga59da75802972a30b8dd75a678e43f988">MCP_REG_DEFVAL</a>&#160;&#160;&#160;0x03</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga9647b2f02fbd71c71177d83e8db88b2a">MCP_REG_INTCON</a>&#160;&#160;&#160;0x04</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga76ffe77fa99ee9675336a8f6812d124a">MCP_REG_IOCON</a>&#160;&#160;&#160;0x05</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga576054b61423489bfa1b5a599ab521bc">MCP_REG_GPPU</a>&#160;&#160;&#160;0x06</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga9c0db6a32ad0833a12b05312837fc3fd">MCP_REG_INTF</a>&#160;&#160;&#160;0x07</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga965a6db7b4c0ec6a19cf3ab9bdcb3b2a">MCP_REG_INTCAP</a>&#160;&#160;&#160;0x08</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga0873e9ed25390d2cc32998efbac19a23">MCP_REG_GPIO</a>&#160;&#160;&#160;0x09</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga7523742d1d87a4a3c410485bba665bd9">MCP_REG_OLAT</a>&#160;&#160;&#160;0x0A</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga741f6d111c68ddee08f95e23bf74cf3e">MCP_BIT_INTPOL</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#gad1c578e55e56fa66b82ffa726141cdfb">MCP_BIT_ODR</a>&#160;&#160;&#160;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga4d3aa537847f37d3f80dba5147807212">MCP_BIT_DISSLW</a>&#160;&#160;&#160;4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#gae3c89839afc29359f68416f791b3e707">MCP_BIT_SREAD</a>&#160;&#160;&#160;5</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga7e4e83c51ea9e2aad0bbdaa7d39e6463">MCP_I2C_ADDR</a>&#160;&#160;&#160;0x40</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga5bea4888063c481ee89a47abe6211ab3">MCP23008setupIO</a> (tSensors link, byte addr, byte mask, byte pullup)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#gad1082dc1a96d405bb833c9e9912ec355">MCP23008setupIO</a> (tSensors link, byte addr, byte mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#gad2da8e6ba343f03f7ce6d13c821eeeab">MCP23008readIO</a> (tSensors link, byte addr, byte mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#gaa7cbe31bfad78367488c4b7164fd1af4">MCP23008readIO</a> (tSensors link, byte addr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga547108b4d7f95d317b6a65e7db21f69c">MCP23008writeIO</a> (tSensors link, byte addr, byte mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga47779249fa3f6245b2877777ce81ad92">MCP23008writeReg</a> (tSensors link, byte addr, byte reg, byte data)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga93b8b8f3f7cb7ba07266c5bade314006">MCP23008readReg</a> (tSensors link, byte addr, byte reg)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#ga9d075a08bd8b8baaabc6e75af1e7d724">MCP23008_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mcp23008.html#gad56219cc18e4ef2255889090157ce182">MCP23008_I2CReply</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Microchip MCP23008 </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga4d3aa537847f37d3f80dba5147807212"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_BIT_DISSLW" ref="ga4d3aa537847f37d3f80dba5147807212" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_BIT_DISSLW&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Slew Rate control bit for SDA output </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00055">55</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga741f6d111c68ddee08f95e23bf74cf3e"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_BIT_INTPOL" ref="ga741f6d111c68ddee08f95e23bf74cf3e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_BIT_INTPOL&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This bit sets the polarity of the INT output pin </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00053">53</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad1c578e55e56fa66b82ffa726141cdfb"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_BIT_ODR" ref="gad1c578e55e56fa66b82ffa726141cdfb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_BIT_ODR&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This bit configures the INT pin as an open-drain output </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00054">54</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="gae3c89839afc29359f68416f791b3e707"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_BIT_SREAD" ref="gae3c89839afc29359f68416f791b3e707" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_BIT_SREAD&#160;&#160;&#160;5</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sequential Operation mode bit </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00056">56</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga7e4e83c51ea9e2aad0bbdaa7d39e6463"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_I2C_ADDR" ref="ga7e4e83c51ea9e2aad0bbdaa7d39e6463" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_I2C_ADDR&#160;&#160;&#160;0x40</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Default base address (A0-A2 tied to gnd) </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00058">58</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga59da75802972a30b8dd75a678e43f988"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_DEFVAL" ref="ga59da75802972a30b8dd75a678e43f988" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_DEFVAL&#160;&#160;&#160;0x03</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>DEFAULT COMPARE REGISTER FOR INTERRUPT-ONCHANGE </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00043">43</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga90bb931e62804ca37a9300703b8fe75e"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_GPINTEN" ref="ga90bb931e62804ca37a9300703b8fe75e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_GPINTEN&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>INTERRUPT-ON-CHANGE CONTROL REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00042">42</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga0873e9ed25390d2cc32998efbac19a23"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_GPIO" ref="ga0873e9ed25390d2cc32998efbac19a23" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_GPIO&#160;&#160;&#160;0x09</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>PORT REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00049">49</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga576054b61423489bfa1b5a599ab521bc"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_GPPU" ref="ga576054b61423489bfa1b5a599ab521bc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_GPPU&#160;&#160;&#160;0x06</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>PULL-UP RESISTOR CONFIGURATION REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00046">46</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga965a6db7b4c0ec6a19cf3ab9bdcb3b2a"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_INTCAP" ref="ga965a6db7b4c0ec6a19cf3ab9bdcb3b2a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_INTCAP&#160;&#160;&#160;0x08</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>INTERRUPT CAPTURE REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00048">48</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga9647b2f02fbd71c71177d83e8db88b2a"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_INTCON" ref="ga9647b2f02fbd71c71177d83e8db88b2a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_INTCON&#160;&#160;&#160;0x04</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>INTERRUPT CONTROL REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00044">44</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga9c0db6a32ad0833a12b05312837fc3fd"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_INTF" ref="ga9c0db6a32ad0833a12b05312837fc3fd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_INTF&#160;&#160;&#160;0x07</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>INTERRUPT FLAG (INTF)REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00047">47</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga76ffe77fa99ee9675336a8f6812d124a"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_IOCON" ref="ga76ffe77fa99ee9675336a8f6812d124a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_IOCON&#160;&#160;&#160;0x05</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>CONFIGURATION REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00045">45</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga8a33d4282df2429f6736aeb043cab6c5"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_IODIR" ref="ga8a33d4282df2429f6736aeb043cab6c5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_IODIR&#160;&#160;&#160;0x00</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>I/O DIRECTION REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00040">40</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga6435c71cc8eb951b14a25a55d4102697"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_IPOL" ref="ga6435c71cc8eb951b14a25a55d4102697" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_IPOL&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>INPUT POLARITY REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00041">41</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga7523742d1d87a4a3c410485bba665bd9"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP_REG_OLAT" ref="ga7523742d1d87a4a3c410485bba665bd9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MCP_REG_OLAT&#160;&#160;&#160;0x0A</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>OUTPUT LATCH REGISTER </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00050">50</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gad2da8e6ba343f03f7ce6d13c821eeeab"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008readIO" ref="gad2da8e6ba343f03f7ce6d13c821eeeab" args="(tSensors link, byte addr, byte mask)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">byte MCP23008readIO </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the states of the pins as specified by the mask</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
    <tr><td class="paramname">mask</td><td>the pins to get the status for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the pins </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00157">157</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa7cbe31bfad78367488c4b7164fd1af4"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008readIO" ref="gaa7cbe31bfad78367488c4b7164fd1af4" args="(tSensors link, byte addr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">byte MCP23008readIO </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the states of all of the pins</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the pins </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00168">168</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga93b8b8f3f7cb7ba07266c5bade314006"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008readReg" ref="ga93b8b8f3f7cb7ba07266c5bade314006" args="(tSensors link, byte addr, byte reg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">byte MCP23008readReg </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>reg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read from the device at the specified register.</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
    <tr><td class="paramname">reg</td><td>the register to write to </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00102">102</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga5bea4888063c481ee89a47abe6211ab3"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008setupIO" ref="ga5bea4888063c481ee89a47abe6211ab3" args="(tSensors link, byte addr, byte mask, byte pullup)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MCP23008setupIO </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>pullup</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Setup the pins as either inputs or outputs as specified by the mask. 0 is input, 1 is output </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
    <tr><td class="paramname">mask</td><td>the pins to change the configuration for </td></tr>
    <tr><td class="paramname">pullup</td><td>the pins to change the internal pullup resistor for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00124">124</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad1082dc1a96d405bb833c9e9912ec355"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008setupIO" ref="gad1082dc1a96d405bb833c9e9912ec355" args="(tSensors link, byte addr, byte mask)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MCP23008setupIO </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Setup the pins as either inputs or outputs as specified by the mask. 0 is input, 1 is output </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
    <tr><td class="paramname">mask</td><td>the pins to change the configuration for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00142">142</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga547108b4d7f95d317b6a65e7db21f69c"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008writeIO" ref="ga547108b4d7f95d317b6a65e7db21f69c" args="(tSensors link, byte addr, byte mask)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MCP23008writeIO </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write to the pins specified specified by the mask.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
    <tr><td class="paramname">mask</td><td>the state of the pins that is to be written </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the pins </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00180">180</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga47779249fa3f6245b2877777ce81ad92"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008writeReg" ref="ga47779249fa3f6245b2877777ce81ad92" args="(tSensors link, byte addr, byte reg, byte data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MCP23008writeReg </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>reg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write data to the device at the specified register.</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">addr</td><td>the address of the MCP23008 </td></tr>
    <tr><td class="paramname">reg</td><td>the register to write to </td></tr>
    <tr><td class="paramname">data</td><td>the data to be written (single byte) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00082">82</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="gad56219cc18e4ef2255889090157ce182"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008_I2CReply" ref="gad56219cc18e4ef2255889090157ce182" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__mcp23008.html#gad56219cc18e4ef2255889090157ce182">MCP23008_I2CReply</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C reply data </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00061">61</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga9d075a08bd8b8baaabc6e75af1e7d724"></a><!-- doxytag: member="microchip&#45;mcp23008.h::MCP23008_I2CRequest" ref="ga9d075a08bd8b8baaabc6e75af1e7d724" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__mcp23008.html#ga9d075a08bd8b8baaabc6e75af1e7d724">MCP23008_I2CRequest</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="microchip-mcp23008_8h_source.html#l00060">60</a> of file <a class="el" href="microchip-mcp23008_8h_source.html">microchip-mcp23008.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
